Overview
of Control and Control Container Guidelines
An ActiveX
Control is essentially a simple OLE object that supports the IUnknown
interface. It will usually support a lot more interfaces in order to offer
functionality, but all additional interfaces may be viewed as optional and as
such, a control container should not rely on any additional interfaces being
supported. By not specifying additional interfaces that a control must support,
a control may efficiently target a particular area of functionality without
having to support particular interfaces to qualify as a control. As always with
OLE, whether in a control or a control container, it should never be assumed
that an interface is available and standard return-checking conventions should
always be followed. It is important for a control or control container to
degrade gracefully and offer alternative functionality if an interface required
is not available.
An ActiveX
control container must be able to host a minimal ActiveX Control as specified
in this appendix, it will also support a number of additional interfaces as
specified in the Containers
It is important
for controls that require optional features, or features specific to a certain
container to be clearly packaged and marketed with those requirements.
Similarly containers that offer certain features or component categories must
be marketed and packaged as offering those levels of support when hosting
ActiveX controls. It is recommended that controls target and test with as many
containers as possible and degrade gracefully to offer less or alternative
functionality if interfaces or methods are not available. In a situation where
a control cannot perform its designated job function without the support of a
component category, then that category should be entered as a requirement in
the registry in order to prevent the control being inserted in an inappropriate
container.
These
guidelines define those interfaces and methods that a control may expect a
control container to support, although as always a control should check the
return values when using QueryInterface or other methods to obtain
pointers to these interfaces. A container should not expect a control to
support anything more than the IUnknown interface, and these guidelines
identify what interfaces a control may support and what the presence of a
particular interface means.